package com.jec.module.sysmonitor.entity.view;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.jec.protocol.unit.BCD;

import lombok.Getter;
import lombok.Setter;

/**
 * Created by jeremyliu on 5/10/16.
 */
@Entity
@Table(name="zhwg_view_terminal_device")
public class TerminalDeviceView implements Serializable{

    /**
	 * 
	 */
	private static final long serialVersionUID = -799141212598499752L;

	@Id
	@Getter @Setter
    private int id;

	@Getter @Setter
    private String name;

    @Column(name="element_id")
    @Getter @Setter
    private int netUnitId;

    @Column(name="element_name")
    @Getter @Setter
    private String netUnitName;

    @Getter @Setter
    private String code;
    
    @Getter @Setter
    private String location;
    
    @Getter @Setter
    private String category;


    @JsonIgnore
    public BCD getDeafultPort(){
        return BCD.fromString(String.valueOf(code));
    }
}
